//
//  HBQsmListTableView.m
//  HelloBeeQuick
//
//  Created by 李建强 on 16/8/20.
//  Copyright © 2016年 LiYiLin. All rights reserved.
//

#import "HBQsmListTableView.h"
#import "HBQsmListModel.h"
#import "HBQsmListCell.h"
@interface HBQsmListTableView ()<UITableViewDataSource,UITableViewDelegate>



@end



@implementation HBQsmListTableView 


-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
        self.dataSource = self;
        self.delegate= self;
        [self registerClass:[HBQsmListCell class] forCellReuseIdentifier:@"cell"];
    }
    
    return self;
    
}

-(void)setListArray:(NSArray *)listArray{
    
    _listArray = listArray;

    [self reloadData];
}



-(void)setupUI{
    
//    self.backgroundColor = [UIColor lightGrayColor];
    
    self.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    [self reloadData];
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.listArray.count;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    HBQsmListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
//    
//    cell.textLabel.text = self.listArray[indexPath.row][@"name"];
//    cell.textLabel.font = [UIFont systemFontOfSize:15];
    cell.model = self.listArray[indexPath.row];
    
    return cell;
}








@end
